package org.young.common.generator;

/**
 * 代码生成类
 */
public class CodeGenerator {

	protected void generate(CodeGeneratorConfig config) throws Exception {
		MybatisGeneratorUtil.generator(config.isExact(), config.getJdbcDriver(), config.getJdbcUrl(), config.getJdbcName(),
				config.getJdbcPassword(), config.getParentModule(), config.getModule(), config.getDatabase(), config.getTablePrefix(),
				config.getPackageName(), config.getReturnIdTables(), config.getGeneratorClassLocationModule(),config.getUseJSR310Types());
	}

	public static void main(String[] args) {
		try {
			new CodeGenerator().generate(new CodeGeneratorConfig(
					"",
					"young-rbac",
					"young-rbac",
					"sys_",
					"org.young.rbac",
					"young-common",
					"com.mysql.cj.jdbc.Driver",
					"jdbc:mysql://81.70.168.71:3306/young-rbac?serverTimezone=Asia/Shanghai",
					"root", "Sowhat?", true
			));
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}
